

import { count } from "console";
import React, { Component } from "react";
import type { ReactNode } from 'react'


interface iState {

}
export default class App extends Component {

    btn1(val:string){
        console.log('btn1',val);
        this.setState({
            count:this.state.count+1
        })
    }

    btn2 = (val:string)=>{
        console.log('btn2' , val);
        this.setState({
            count:this.state.count+5
        })
    }

    btn3 =(val:string)=>{
        console.log(this , val);
    }


    state = {
        count:100
    }
    render() {

        return <>
            <div>
                <h1>{this.state.count}</h1>
                <button onClick={()=>{
                    this.btn1('this is 1')
                }}>加1</button>

                <button onClick={()=>{
                    this.btn2('wadaadaw')
                }}>加5</button>

                <button onClick={this.btn3.bind(this,'这是参数')}>点击传参</button>
            </div>
        </>
    }

}